package com.chuqiyun.authorization.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chuqiyun.authorization.entity.Bill;

/**
 * 账单(Bill)表服务接口
 *
 * @author mryunqi
 * @since 2023-04-19 17:06:37
 */
public interface BillService extends IService<Bill> {

    /**
     * @Author: mryunqi
     * @Description: 创建支付账单
     * @DateTime: 2023/4/22 14:20
     * @Params: String uuid 用户唯一UUID
     * @Params: String traceNo 系统生成订单号
     * @Params: String paymentType 支付类型别名
     * @Params: Boolean money 变动金额
     * @Params: Boolean balance 余额
     * @Return int
     */
    int insertPayBill(String uuid, String traceNo,
                      String paymentType, Double money,
                      Double balance);

    /**
     * @Author: mryunqi
     * @Description: 获取指定订单号的账单
     * @DateTime: 2023/4/22 15:31
     * @Params: String orderId 系统订单号
     * @Return Bill
     */
    Bill getBillByOrderId(String orderId);

    /**
     * @Author: mryunqi
     * @Description: 支付成功账单更新
     * @DateTime: 2023/4/22 15:31
     * @Params: Bill
     * @Return int
     */
    int updatePayBillSuccess(Bill bill);

    /**
     * @Author: mryunqi
     * @Description: 获取指定页所有账单
     * @DateTime: 2023/4/22 19:58
     * @Params: Integer page 页数
     * @Params: Integer size 每页数据
     * @Return Page<Bill>
     */
    Page<Bill> getBillList(Integer page, Integer size);

    Page<Bill> getBillList(Integer page, Integer size, QueryWrapper<Bill> queryWrapper);
}

